package nc.impl.yst;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.impl.pub.ace.AcePBPubServiceImpl;
import nc.ui.querytemplate.querytree.IQueryScheme;
import nc.vo.yst.pb.AggPbHVO;
import nc.vo.yst.sales.AggSalesHVO;
import nc.itf.yst.IPBMaintain;
import nc.vo.pub.BusinessException;

public class PBMaintainImpl extends AcePBPubServiceImpl
		implements IPBMaintain {

	@Override
	public void delete(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		super.pubdeleteBills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] insert(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubinsertBills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] update(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubupdateBills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] query(IQueryScheme queryScheme)
			throws BusinessException {
		return super.pubquerybills(queryScheme);
	}

	@Override
	public AggPbHVO[] save(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubsendapprovebills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] unsave(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubunsendapprovebills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] approve(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubapprovebills(clientFullVOs, originBills);
	}

	@Override
	public AggPbHVO[] unapprove(AggPbHVO[] clientFullVOs,
			AggPbHVO[] originBills) throws BusinessException {
		return super.pubunapprovebills(clientFullVOs, originBills);
	}

	@Override
	public int UpdatePbHVO(String pk_head,String zt) throws DAOException {
		BaseDAO dao= new BaseDAO();
		String sql="Update pb_h set bbzx='"+zt+"' where pk_head='"+pk_head+"' and isnull(dr,0)=0";
	    return dao.executeUpdate(sql);
	}

	@Override
	public String[] queryPKs(IQueryScheme queryScheme) throws BusinessException {
		return super.queryPKs(queryScheme);
	}

	@Override
	public AggPbHVO[] queryBillByPK(String[] pks) throws BusinessException {
		return super.queryBillByPK(pks);
	}
}
